﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLNhaThuoc.DAL;
using QLNhaThuoc.DTO;

namespace QLNhaThuoc.BL
{
    class ThuocControl
    {
        ThuocDA thuocDA = new ThuocDA();

        public Thuoc[] LayListThuoc()
        {
            return thuocDA.LayListThuoc();
        }

        public void ThemThuoc(Thuoc info)
        {
            thuocDA.insert(info);
        }

        public void XoaThuoc(Thuoc info)
        {
            thuocDA.delete(info);
        }

        public void CapNhatThuoc(Thuoc info)
        {
            thuocDA.update(info);
        }

        public bool KiemTraPK(Thuoc info)
        {
            return thuocDA.KiemTraPK(info);
        }

        public Thuoc[] TimKiem(string expr)
        {
            return thuocDA.Search(expr);
        }

        public Thuoc LayThuocTheoMa(string MaThuoc)
        {
            return thuocDA.LayThuocTheoMa(MaThuoc);
        }

        public string[] GetAllColumns()
        {
            return thuocDA.GetAllColumns();
        }
    }
}
